package com.taobao.ucenter.feignclient;

import com.taobao.base.model.RestResponse;
import com.taobao.ucenter.model.dto.Users;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class MeClientFactory implements FallbackFactory<MeClient> {
    @Override
    public MeClient create(Throwable throwable) {
        return new MeClient() {


            @Override
            public RestResponse<String> insertUser(Users users) {
                log.error("insertUser error", throwable);
                return RestResponse.validfail(throwable.getMessage());
            }
        };
    }
}
